var app = getApp();

Page({
  data: {
    hotel: [],
    isFirst: 1,
    keywords: "",
    isTrue: 0
  },
  onLoad: function (t) {
    app.getUrl(this), app.getSystem(this);
  },
  search_hotel: function (t) {
    var e = this,
      a = t.detail.value;
    "" != a ? app.util.request({
      url: "entry/wxapp/JdList",
      cachetime: "0",
      data: {
        keywords: a,
        pagesize: 100,
        longitude: wx.getStorageSync("longitude"),
        latitude: wx.getStorageSync("latitude")
      },
      success: function (t) {
        e.setData({
          hotel: t.data,
          isFirst: 0
        });
      }
    }) : e.setData({
      hotel: [],
      isFirst: 1
    });
  },
  search_result: function (t) {
    var e = t.currentTarget.dataset.id;
    wx.navigateTo({
      url: "../hotel_list/hotel_info?hotel_id=" + e + "&type=1"
    });
  },
  search_tanqi: function () {
    var a =this;
    a.setData({
      isTrue: 1
    });
  },
  search_shiqu:function(){
    var a =this;
    a.setData({
      isTrue: 0,
      hotel: [],
      isFirst: 1
    });
  },
  search_kong: function () {
    console.log('12121212')
    this.setData({
      keywords: ""
    });
  }
});